home *** CD-ROM | disk | FTP | other *** search
/ Saar AMOK 2 / Saar AMOK II - Oktober 1994 (1994)(Kreativ Marketing)(DE)[!][I-7598].iso / disks / 651_700 / 658 / set040 / set040.doc < prev    next >
Text File  |  1993-11-27  |  43KB  |  988 lines

  1.  
  2. PROGRAM  
  3.         Set040  (2nd Release)
  4.                 
  5.         The command syntax of this new release of Set040
  6.         is not compatible with the older V1.xx releases of 
  7.         Set040.  Please read this entire document file so you 
  8.         can become familiar with the new syntax.
  9. SOURCE
  10.     Written in Assembly Language using Macro68 V3.170
  11.  
  12. AUTHOR        
  13.     Nic Wilson
  14.     Nic Wilson Software
  15.     P.O. Box 1164
  16.     TOOWOOMBA QUEENSLAND 4350
  17.     Australia
  18.                 
  19.     EMAIL  cbmaus!cbmozq!wilson!nicw@cbmvax.commodore.com
  20.     CBMNET nicw@wilson.adsp.sub.org
  21.     TELEPHONE/FAX +61 76 358539 After Hours Australian Time
  22.             
  23.  
  24. DISTRIBUTION    
  25.     
  26.     This release of Set040 is shareware and freely distributable.  
  27.     
  28.     Electronic distribution is allowed.
  29.     
  30.         DISTRIBUTION
  31.  
  32.         Permission is hereby granted to distribute this program on the
  33.         condition that no profit is gained gained from its distribution.
  34.         All document files must accompany it and remain unchanged.  If the
  35.         document files are crunched, then a suitable de-cruncher must also
  36.         be supplied with them that works on ALL CPU version Amigas.
  37.  
  38.         It MAY NOT be distributed on those so called 'copyright' non
  39.         distributable PD disks.  It MAY be distributed on a BBS as long as
  40.         that BBS does NOT have individual charges for downloading of files.
  41.  
  42.         Please send any bug reports or ideas to the address at the top of
  43.         this file.
  44.  
  45.         Commercial companies may also distribute the program without
  46.         permission, but I would appreciate being notified so I can
  47.         inform you of updates.
  48.  
  49.     * * * DONATIONS * * *
  50.         ---------------------
  51.  
  52.         TO DATE THE DISTRIBUTION AND USAGE HAS BEEN LARGE, BASED ON THE
  53.         AMOUNT OF EMAIL AND UPGRADE ENQUIRIES I HAVE RECEIVED,  AND YET I
  54.         HAVE RECEIVED VERY FEW CONTRIBUTIONS.  COME ON GUYS, I SPENT 12
  55.         MONTHS WRITING THIS PROGRAM AND I AM STILL UPDATING AND ENHANCING
  56.         IT.
  57.  
  58.         A dontation of $25.00 American or equivalent is suggested, OR if
  59.         you cannot afford that, any amount will be gratefully accepted.
  60.  
  61.         Overseas users, please DO NOT send personal or EuroChecks.  They
  62.         are very difficult and expensive to cash.  Please send an overseas
  63.         bank draft in Australian Dollars drawn on any Australian bank.  Your
  64.         local bank should be able to help you with this.
  65.  
  66.         Any cash currency is acceptable as it is very easy to convert to
  67.         Australian.
  68.  
  69.         The following credit cards are accepted.
  70.  
  71.         OVERSEAS  -> MASTERCARD, VISA.
  72.  
  73.         AUSTRALIA -> BANKCARD, MASTERCARD, VISA.
  74.  
  75.         These cards can be accepted by mail, email or phone.  Confidentiality
  76.         is guaranteed.  If using credit card, please include the card number,
  77.         the expiry date and the name as it appears on the card.
  78.  
  79.         Donations in the form of software or hardware is also acceptable.  I
  80.         write many reviews here in Australia and quite often give free plugs
  81.         to companies that have been generous enough to donate to my work.
  82.  
  83. COPYRIGHT
  84.     This program, and its source code & document files are
  85.     Copyright (C) Nic Wilson Software 1991-1993.
  86.  
  87. FUNCTION
  88.     1. To remap Kickstart V2.04 or greater from ROM into
  89.        FAST RAM on an Amiga equipped with a 68040 CPU, using
  90.        the MMU, with options for various functions.
  91.        This remapped kickstart gives a vast improvement in
  92.        the speed the 68040 can access kickstart, and faster than
  93.        any hardware re-mapping of Kickstart.
  94.     2. To remap Kickstart V2.04 or greater on an Amiga equipped
  95.        with an A3640 card such as the A4000 and to survive a
  96.        reboot without using the MMU.
  97.     3. FASTROM can be done in a default memory efficient mode,
  98.        or a full map addressing mode.
  99.     4. To allow the FASTROM remap to be removed and
  100.        all resources reclaimed.
  101.     5. To load and remap, a different Kickstart from disk or file
  102.        and use the MMU to boot into this Kickstart.  Kickstarts
  103.        1.2, 1.3. 2.04, 3.0 or greater are supported.  An option
  104.        to completely survive a reboot is supported.
  105.     6. To manipulate both the 68040 caches and the various modes.
  106.     7. To display brief or verbose information regarding the
  107.        setting of the MMU remap, and 68040 registers and modes.
  108.     8. To switch between the 68040 and 68030 on any Progressive
  109.        Peripherals & Software 68040 card.
  110.     9. To sum up, this program gives the user of a 68040 the
  111.        facilities he lost when ROMS were fitted, plus some
  112.        extra ones and with greater flexibility.
  113.  
  114.                                   Page 1
  115. CONTENTS
  116.  
  117.     Disclaimer.............................................. 2
  118.  
  119.     Acknowledgements........................................ 2
  120.  
  121.     Archive................................................. 2
  122.  
  123.     Requirements............................................ 2
  124.  
  125.     Other info.............................................. 2
  126.  
  127.     Usage................................................... 3
  128.  
  129.     Default................................................. 3
  130.  
  131.     Option availability..................................... 3
  132.     
  133.     A4000 MAPROM............................................ 3
  134.     
  135.     Example of A4000 startup-sequence entry................. 3
  136.  
  137.     Full definitions........................................ 4
  138.     
  139.     FULLMAP OPTION.......................................... 6
  140.     
  141.     Kickstart logical and physical Write-Protection......... 7
  142.  
  143.     Kickstart 1.2 and 1.3................................... 7
  144.  
  145.     Kickstart 2.0x.......................................... 8
  146.  
  147.     KICKROM to FASTROM...................................... 8 
  148.  
  149.     Reset survival.......................................... 8
  150.  
  151.     Program examples........................................ 9
  152.  
  153.     Example of installing FASTROM........................... 9
  154.  
  155.     Example of installing KICKROM........................... 9
  156.  
  157.     Example of converting a KICKROM to FASTROM.............. 9
  158.  
  159.     Example of converting a KICKROM to FASTROM FULLMAP...... 9
  160.  
  161.     Example of installing the reset handler................. 9
  162.  
  163.     Example of startup-sequence entry....................... 10
  164.  
  165.     Example of removing the reset handler................... 10
  166.  
  167.     Example of Cache manipulation........................... 10
  168.  
  169.     Example of removing a FASTROM........................... 10 
  170.  
  171.     Example of switching from 68040 to 68030................ 11
  172.  
  173.     Improvements............................................ 11
  174.  
  175.     Technical notes......................................... 12
  176.  
  177.     The DEFAULT setup....................................... 13
  178.  
  179.     The FULLMAP setup....................................... 14
  180.  
  181.     Trademarks and References............................... 14 
  182.     
  183. DISCLAIMER
  184.     Although I beleive this software performs the functions
  185.     described in this document file, the program is supplied
  186.     "as is" without any warranty on performance of any kind,
  187.     either implied or expressed.  Nic Wilson Software will not
  188.     be liable for any damages, including lost profits, lost 
  189.     savings or other incidental or consequential damages arising 
  190.     from the use or inability to use such software, even if 
  191.     Nic Wilson Software has been advised of the possibility
  192.     of such damages, or for any claim by any other party.       
  193.     This disclaimer supercedes any other document or disclaimer
  194.     on previous versions either written or verbal.
  195.    
  196. ACKNOWLEDGEMENTS
  197.  
  198.     Thank you to Dave Haynie and Michael Sinz for their answers
  199.     to my questions regarding the 68040 over EMAIL.
  200.  
  201.     Thank you to Progressive and Peripherals and Software for 
  202.     their generosity with the A3000/68040 cards.
  203.  
  204.     Thank you to my friend Paul Coward (Digisoft) for a brilliant 
  205.     assembler, Macro68 V3.170.  Set040 assembles with an average
  206.     pass time of 0.41 secs to executable, and without it 68040
  207.     code in new syntax would have been difficult.
  208.  
  209.     Thank you to William J Coldwell for his enhancement suggestions
  210.     and for information on errata documents on the 68040 CPU.
  211.  
  212. REQUIREMENTS
  213.     Depending on the function, the requirements to launch
  214.     particular functions are different and are as follows:-
  215.                 
  216. FASTROM    AmigaDOS V2.04 or greater, 68040 CPU, 1MB FAST RAM minimum
  217. KICKROM    AmigaDOS V2,04 or greater, 68040 CPU, 1MB CHIP RAM minimum
  218. KICKROM
  219. to FASTROM AmigaDOS V1.2  or greater, 68040 CPU, 1MB FAST RAM minimum
  220. MAPROM     AmigaDOS V2.04 or greater and an A3640 card or A4000.
  221. TOGGLECPU  AmigaDOS V2.04 or greater, with any PP&S 68040 card *
  222.                 
  223.         * If an A3000 card, the A3000 must be a 25MHZ model, NOT 16MHZ.
  224.                 
  225. OTHER INFO
  226.     This program was written and tested on an Amiga A3000 with a 
  227.     Progressive Peripherals & Software 68040 25MHZ card and with a
  228.     PP&S Mercury card.  More recent versions are written and tested on 
  229.     the Amiga 4000.  It is currently working on, and being regularly 
  230.     tested on a CSA 40/4 Magnum Pro.  If it works on your card please 
  231.     let me know.  If it doesn't, let me know too and maybe we can rectify 
  232.     it for yours and other 68040 cards.
  233.     
  234.                                   Page 2    
  235.  
  236. USAGE        
  237.     Set040 [FASTROM option option ...]
  238.            [KICKROM [path|DFx: FORCE]]
  239.            [MAPROM path/file FORCE]] 
  240.            [option option ...]
  241.  
  242.         FULLMAP [NO]REVERSE, [NO]DCACHE, [NO]ICACHE, [NO]CACHE [NO]ZCACHE, 
  243.         [NO]RESET, [NO]COPYBACK, [NO]ATCCBACK, [NO]DTT0CBACK, [NO]DTT1CBACK,
  244.         NOCLICK, NOTITLE, TOGGLECPU, NOFASTROM, VERBOSE, HELP
  245.     
  246.     All options can be supplied in either upper or lower case.
  247.     
  248.     Command line examples are given on Page 9.
  249.     
  250.     Some options can only be used with certain settings and are 
  251.     shown below.
  252.     
  253. DEFAULT:
  254.  
  255.     If no options are supplied, Set040 will display its default
  256.     brief information on the current settings.  Copyback modes are
  257.     not shown in this display.  They are shown in full with the
  258.     'VERBOSE' option.
  259.  
  260. OPTION AVAILABILITY
  261.  
  262.     These options are only valid as sub-options to FASTROM or KICKROM
  263.  
  264.     NOCLICK, NOTITLE, [NO]RESET
  265.     
  266.     This option is only valid as a sub-option to KICKROM
  267.  
  268.     FORCE
  269.     
  270.     These options are only valid as sub-options to FASTROM
  271.  
  272.     FULLMAP [NO]REVERSE 
  273.     
  274.     These options are available as sub-options to FASTROM or KICKROM, 
  275.     or separately after a FASTROM or KICKROM installation to modify 
  276.     current settings.
  277.     
  278.     [NO]DCACHE, [NO]ICACHE, [NO]CACHE [NO]ZCACHE, [NO]COPYBACK, 
  279.     [NO]ATCCBACK, [NO]DTT0CBACK, [NO]DTT1CBACK  
  280.  
  281.     These options are only valid separately.
  282.  
  283.     TOGGLECPU, HELP, VERBOSE
  284.     
  285.     This option is only valid after ROM-FASTROM installation.
  286.     
  287.     NOFASTROM
  288.     
  289.     
  290.                                   Page 3    
  291.  
  292.  
  293. DEFINITIONS        
  294.         
  295. FASTROM           - Remaps the current ROM or KICKROM kickstart to FAST
  296.             RAM.  Without any further options the default 
  297.             configuration of CACHE NOZCACHE COPYBACK will be 
  298.             installed.  If other options are used, they must 
  299.             follow this option.  The setup can be either the
  300.             default mapping for FULLMAP mapping.
  301.             
  302. FULLMAP          - Installs complete mapping for the entire 4 Gig space
  303.             If you are using 68040.library 37.10 or greater, this 
  304.             option is redundant and will just waste memory.  Use a 
  305.             default setup when using these versions of the library.
  306.             See the 'FULLMAP OPTION' heading on Page 6 for more
  307.             information on this option.  
  308.             
  309. NOFASTROM      - Remove the FASTROM setup and free all resources.
  310.             This option is not valid for KICKROM-FASTROM.            
  311.             
  312. [NO]REVERSE       - Allocate memory for FASTROM from either the top
  313.             (REVERSE) of the memory map or from the bottom    
  314.             (NOREVERSE) of the map.  If this option is not
  315.             specified, it will default to REVERSE.  Always use
  316.             the default first, unless you have trouble surviving
  317.             a reset, and then try the NOREVERSE option.
  318.             
  319. [NO]DCACHE        - Enable or disable the DATA CACHE.
  320. [NO]ICACHE        - Enable or disable the INSTRUCTION CACHE.
  321. [NO]CACHE         - Enable or disable both the INSTRUCTION & DATA CACHES.
  322. [NO]ZCACHE        - Enable or disable caching the ZorroII address area.
  323. [NO]RESET         - Install or remove the reset handler.
  324. [NO]COPYBACK      - Enable or disable Copyback globally (DTT0, DTT1 & ATC).
  325. [NO]ATCCBACK      - Enable or disable Copyback for:
  326.  
  327.             default - $01000000-$03FFFFFF.
  328.             FULLMAP - $01000000-$3FFFFFFF.
  329.  
  330. [NO]DTT0CBACK     - Enable or disable Copyback for: 
  331.     
  332.             default - $08000000-$0FFFFFFF.
  333.             FULLMAP - $40000000-$7FFFFFFF.
  334.             
  335. [NO]DTT1CBACK     - Enable or disable Copyback for:
  336.  
  337.             default - $04000000-$07FFFFFF.
  338.             FULLMAP - $80000000-$FFFFFFFF.
  339.             
  340. NOCLICK           - Stop the floppy drives from clicking.  This is a 
  341.             better way than the various noclick programs that
  342.             are around (including my own), as experience shows
  343.             that changing the flags in the TDU_ structure actually
  344.             slows the response time of the drive seeing a diskchange.
  345. NOTITLE           - Disable changing the Workbench title.
  346. TOGGLECPU         - Toggle the 030 & 040 modes (PP&S 040 CARD ONLY).
  347. HELP or ?         - Displays brief help on various options.
  348. VERBOSE           - Verbose listing of current settings.  This option will
  349.             display the current settings, the type of caching for 
  350.             memory areas, some of the 68040 registers and the
  351.             kickstart mapping addresses.
  352. FORCE          - This is an option to KICKROM, it forces a new KICKROM
  353.             to be installed, when a KICKROM is already installed.
  354.             This saves the long process that used to be required to 
  355.             do this.  This has been done as an option, so that the
  356.             kickrom line in your startup-sequence will not take
  357.             effect on subsequent resets.
  358.             
  359. MAPROM            Takes a single parameter, of the kickstart file to be
  360.             loaded.  This function requires an A3640 card or A4000.
  361.             If no parameter is specified then a default of 
  362.             'DEVS:kickstart' will be loaded.  If the current version
  363.             of kickstart is the same as the file and error will result
  364.             unless the FORCE option is specified.
  365.  
  366.               NOTE. The MMU *must* be off for this option to 
  367.         work, boot with no startup-sequence before attempting
  368.         it, or place is conditionally before 'setpatch' in
  369.         the startup-sequence.  
  370.         
  371.         EXAMPLE OF STARTUP-SEQUENCE ENTRY
  372.         
  373.         IF EXISTS C:Set040
  374.            Set040 MAPROM DEVS:kickstart
  375.         ENDIF
  376.         SetPatch QUIET
  377.  
  378.  
  379.  
  380.                                   Page 4
  381.                                   
  382. KICKROM [path|DFx:] - 
  383.  
  384.     Loads and remaps a kickstart to CHIP RAM then reboots into the 
  385.     new kickstart.  This option is always valid, except, when KICKROM 
  386.     is already installed the FORCE option must be specified.  After 
  387.     installation, it may be moved to fast ram by using the FASTROM 
  388.     option.  If you have a board that has hardware fastrom ability, 
  389.     this must be disabled before any attempt to use the KICKROM option.
  390.     The KICKROM option is capable of remapping a kickstart to any 
  391.     address.  This is transparent to the user as the program checks the 
  392.     kickstart and extracts the address it is destined for, and maps it 
  393.     to that address.  You do not need memory at this address, it will 
  394.     be mapped to that address with the MMU.  Set040 has the ability to
  395.     use the kickstart files that come supplied on the "Kickfile" disk, 
  396.     although if these are used on an A3000 the hard disk will not boot 
  397.     and your fast memory will not be available.  A3000 users should make 
  398.     kickstart files from superkickstart disks, using the 'Update2.x' 
  399.     program.
  400.     This function requires an Amiga with at least 1MB of chip memory 
  401.     for it to work.  It will attempt to allocate about 576k of
  402.     memory within the chip memory area as high as possible.  The
  403.     allocated chip memory from this allocated block to the end of
  404.     the next one megabyte boundary, will be hidden from exec after
  405.     the reboot.  When Set040 is used again, to convert KICKROM to 
  406.     FASTROM, this hidden memory will be added to the free pool.  If 
  407.     your chip memory usage is large, Set040 may not be able to obtain 
  408.     the required memory.  If this happens I suggest closing as many 
  409.     programs as possible or re-booting with a minimum set-up so that
  410.     Set040 can allocate the memory it requires.  
  411.     Even though we are about to re-boot, into a new kickstart, Set040
  412.     will NOT just take the ram required, as this may cause a crash. 
  413.     If the memory allocated, falls within the first megabyte on an Amiga 
  414.     with two megabytes of chip ram, the second megabyte will be lost 
  415.     completely unless added in with the 'addmem' command.  This should 
  416.     not happen under normal circumstances, as Exec normally allocates 
  417.     memory from lower addresses first.  This means that the memory 
  418.     allocated by Set040 should always fall within the highest one 
  419.     megabyte block.  Although when this KICKROM is converted to FASTROM, 
  420.     all the chip memory will be added back to the free pool, including 
  421.     the top megabyte.
  422.     When installing the kickstart, a screen showing a 68040 CPU picture 
  423.     informing you of the loading will be shown , then it will inform you 
  424.     that the kickstart is being patched to prevent the MMU from being
  425.     disabled, and then, that system will be rebooted.  During  this reboot, 
  426.     there will be a 3 second delay and then the power light will flash 
  427.     rapidly to inform you that this function is operating successfully.  
  428.     See 'FORCE' option also.
  429. path  =
  430.     If a path/filename or DFx: is not given, then Set040 will attempt
  431.     to load a default kickstart file 'DEVS:kickstart'.
  432.     Full path and filename to a Kickstart file.
  433.     The Kickstart file can be a 256K file (1.2 or 1.3) or a
  434.     512k file (2.0x) as saved by the "Update2.x" or "Update1.3"
  435.     program supplied with your A3000.  
  436.     
  437. DFx:  =
  438.         Instead of a filename, the kickstart can be loaded from an
  439.      A3000 SuperKickstart disk or an A1000 Kickstart disk.  If a
  440.      SuperKickstart is used a requester window will open and prompt you 
  441.      for the Kickstart version you require.  These choices will be "V1.3" 
  442.      or "V2.0".  If the drive you specified does not have a disk in it, 
  443.      you will be prompted for a disk via a requester.
  444.                                   
  445.                                   Page 5    
  446.     
  447.  
  448. FULLMAP OPTION
  449.  
  450.     This option required more explanation than could be given in the
  451.     definitions above.  The 'FULLMAP' option is valid as a sub-option 
  452.     to the FASTROM option, for a ROM remap or a KICKROM remap.
  453.  
  454.     *********************************************************************
  455.     If you are using 68040.library 37.10 or greater, this option is 
  456.     redundant and a default setup should be used.  If this option is used 
  457.     on these version of the library, it will only waste memory, as the 
  458.     68040.library replaces Set040's MMU setup and does the entire mapping 
  459.     itself.
  460.     *********************************************************************
  461.  
  462.     The default mapping is limited and was a compromise as explained 
  463.     in the Technical notes on page 12.  The FULLMAP option allows for 
  464.     a full mapping of the entire 4 Gigabyte address space of the 68040 
  465.     processor.  I suggest you read the Technical notes so you may 
  466.     understand the compromises that had to be made for a default setup.
  467.     
  468.     The FULLMAP option has addressed the mapping in an entirely
  469.     different way to the default setup.  This full setup will require
  470.     just over one megabyte of fast memory in order to install the
  471.     FASTROM.  This megabyte includes the room required for the
  472.     Kickstart image, and will be allocated from the highest address
  473.     possible, (unless the NOREVERSE option is given) with the highest 
  474.     priority memory in the map.  This memory however must be 'LOCAL' 
  475.     memory.  If not enough LOCAL memory is available, the attempt will 
  476.     fail.
  477.     
  478.     LOCAL memory is that type of memory that does not "disappear" upon
  479.     a reset, and gets it name because it is usually local to the CPU.
  480.     Set040 tries to allocate this type of memory by adding the 
  481.     MEMF_LOCAL bit to the attributes when calling AllocMem.
  482.     
  483.     One quarter of the memory map is controlled by the ATC, and these
  484.     addresses are $0 to $3FFFFFFF.  These addresses include those locations 
  485.     known as 24 Bit address space, Commodore Reserved areas, A3000 Mother 
  486.     board Fast ram, CoProcessor Slot Expansion, and a portion of the 
  487.     ZorroIII Expansion area.  This means that the ATC is now contolling
  488.     all areas that the default setup allowed altogether, plus a portion of 
  489.     the map that was invalid in the default setup.
  490.     
  491.     The rest of the ZorroIII Expansion area, from address $40000000 to
  492.     $7FFFFFFF is controlled by the DTT0/ITT0 registers.  The rest of the 
  493.     address space from addresses $80000000 to $FFFFFFFF are controlled by
  494.     the DTT1/ITT1 registers and this area is known as 'Reserved by 
  495.     Commodore'.
  496.     
  497.     All areas above the 24 Bit address space will default to
  498.     cachable copyback unless other options are specified.  Remember
  499.     that the options to control ATC, DTT0 and DTT1 copyback are
  500.     still valid with this option, but they will be controlling 
  501.     different areas of the map as explained above.  Normally these
  502.     options will not be required, because the default settings on boot-up
  503.     will be the same as Kickstart normally uses for the 68040.  If these
  504.     options are given after the installation, the 'VERBOSE' option
  505.     will show the changes that will take affect on a certain area
  506.     of the map.  After a reset, all modes will be restored to standard,
  507.     so these will require changing again, if you do not use default 
  508.     values.
  509.     
  510.     The FULLMAP option allows the Kickstart image to be protected from 
  511.     writes, in the physical location as well as the logical location 
  512.     as in the default mode, but due to technical difficulties the physical
  513.     area is only writeprotected, after each reset, when the FASTROM command
  514.     is given.  Even though FASTROM is already installed, when it is
  515.     launched again in the startup, Set040 will recognise that the FASTROM
  516.     is still installed and will make certain tests.  One of these tests
  517.     includes setting the physical location as writeprotected.  The
  518.     VERBOSE option of Set040 shows the logical and physical area settings
  519.     for you to check.  See below (Page 7) for more on this subject.
  520.     
  521. * * * IMPORTANT * * *
  522.     
  523.     You MUST read the document file for the SetPatchPatch program supplied.
  524.     
  525.                               Page 6
  526.     
  527.  
  528. KICKSTART WRITE-PROTECTION
  529.     
  530.     The logical address of kickstart will always be marked as write-
  531.     protected and the error handler will trap any write accesses.  The
  532.     logical addresses will be marked as write-protected on a FASTROM
  533.     FULLMAP    installation.  The default mapping mode does not support
  534.     write-protection of the physical area.  During a reset, this write-
  535.     protection must be removed, otherwise an exception would occur during 
  536.     the Kickstart memory test and SCRAM test routines.  The removal of 
  537.     the write-protection is transparent to the user, and is handled by 
  538.     the reset handler. The write-protection can be re-installed by Set040 
  539.     if the FASTROM option is given.  This would normally happen in the 
  540.     startup-sequence (See Page 10).  When this option is given, Set040 
  541.     will recognise that a FASTROM is already installed and will check to 
  542.     see if it is write-protected at its physical location.  If not, the
  543.     MMU setup will be modified to reflect the write-protected state.  If 
  544.     your startup-sequence entries are similar to the example on Page 10, 
  545.     this process will be automatic and transparent to the user.
  546.     
  547. KICKSTART 1.2 - 1.3
  548.  
  549.           ************************************************************
  550.     ** USE 1.3 or 1.2 WITH CAUTION, THEY ARE NOT FULLY COMPATIBLE **
  551.       ************************************************************
  552.  
  553.     Kickstart 1.2 and 1.3 should not be used on the 68040 without
  554.     extreme caution.  These kickstart were not designed for the
  555.     special cache modes of the 68040.  The ability to install them
  556.     in Set040 has been supplied for testing purposes, incase a 
  557.     programmer does not have a 1.3 Kickstart Amiga to test on.
  558.     
  559.     Watch out for 1.3 'SetClock' commands, they will guru the
  560.     A3000/68040 every time.  Make sure you delete them or replace
  561.     them with your A3000 'SetClock' command.
  562.     
  563.     If the new Kickstart is 1.2 or 1.3,  only the remaining chip 
  564.     memory will be available after booting.  Any FAST RAM on the 
  565.     A3000 mother board will not be available.  This memory must be 
  566.     added to the system with the "addmem" command.  It has been done 
  567.     this way incase the fast memory is not required for some reason.  
  568.     The usage for the 'addmem' command for different memory sizes is 
  569.     shown below.  
  570.         
  571.     When the FAST ram has been added, you may run Set040 again with 
  572.     optional arguments (See KICKROM to FASTROM).  
  573.     
  574.     AddMem usage for A3000 32bit wide fast ram are as follows:
  575.  
  576.     A3000 4MB  32 bit ram = AddMem 7C00000 7FFFFFF
  577.     A3000 8MB  32 bit ram = AddMem 7800000 7FFFFFF
  578.     A3000 12MB 32 bit ram = AddMem 7400000 7FFFFFF
  579.     A3000 16MB 32 bit ram = AddMem 7000000 7FFFFFF
  580.     
  581.                                   Page 7    
  582.     
  583. KICKSTART 2.0x
  584.     If the new Kickstart is 2.0x (V37+) your FASTRAM will still be 
  585.     available and your hard disk would have booted.  The addmem 
  586.     command will not be required.  This set-up will still be in 
  587.     CHIP ram though, and can be moved to fast memory by running Set040 
  588.     with the FASTROM and other options.  
  589.               
  590.    NOTE:    
  591.     FOR COMPATIBILITY REASONS, WHEN THE KICKROM to FASTRAM CONVERSION
  592.     IS PERFORMED, THE DATA CACHE WILL ONLY BE ENABLED FOR V2.0X
  593.     KICKSTARTS, AND WILL BE DISABLED FOR OTHER KICKSTARTS.  IF YOU
  594.     WISH TO CHANGE THIS, OR MANIPULATE THE OTHER CACHES, USE THE
  595.     CACHE OPTIONS.
  596.         
  597.     ONCE THIS KICKROM KICKSTART IS INSTALLED IT CANNOT BE REMOVED WITH 
  598.     THE NOFASTROM OPTION. ANY ATTEMPT TO DO SO WILL GIVE AN ERROR.  
  599.     SEE 'NORESET' OR 'FORCE' OPTIONS, OR SEE 'RESET REMOVAL' BELOW.
  600.  
  601. KICKROM to FASTROM
  602.  
  603.     When a KICKROM set up is first installed, the kickstart
  604.     will be in chip memory.  In this mode you have three options.
  605.     Firstly, may leave it as it is, and it will be lost on the next
  606.     reboot.  Secondly you may install the reset handler, and the
  607.     kickstart will remain in CHIP memory and survive a reboot, or
  608.     thirdly you may use the FASTROM option(s) to move it to FAST
  609.     memory with a default, or FULLMAP setting, and optionally survive 
  610.     a reboot.
  611.     
  612. RESET SURVIVAL
  613.  
  614.     The KICKROM function, by default will not survive a hardware
  615.     (keyboard) reset.  This can however be installed by using the
  616.     RESET option.
  617.     
  618.     Separate installation allows you to install it should you forget, 
  619.     when doing a KICKROM to FASTROM conversion, or allows you make 
  620.     a CHIP ram KICKROM setup survive a reboot, without ever converting 
  621.     to FAST ram.  This is useful in situations where enough FAST ram is 
  622.     not available or the FAST memory does not come on-line early enough 
  623.     in the reset-boot sequence.  If you find that the KICKROM-FASTROM 
  624.     does not survive a reboot or crashes, then try a CHIP ram KICKROM 
  625.     setup. 
  626.     
  627.     Once installed the current KICKROM kickstart will survive every 
  628.     reboot until removed with the NORESET option, or changed with the
  629.     FORCE option.
  630.         
  631.     PLEASE NOTE THAT THIS HANDLER USES THE COLDCAPTURE VECTOR, AND THE
  632.     COOLCAPTURE VECTOR DURING THE RESET PROCESS.  SOME ANTI-VIRUS 
  633.     PROGRAMS (INCLUDING MY OWN NoVirus, PRIOR TO BRAINFILE 066) MAY SEE 
  634.     SOME POSSIBLE NEW VIRUS  IN MEMORY,  BUT DO NOT WORRY, IT IS ONLY 
  635.     THIS RESET HANDLER.  THESE VECTORS WERE CHOSEN SO THAT RAD: TYPE
  636.     DEVICES MAY ALSO SURVIVE A REBOOT AND NOT CONFLICT WITH Set040.
  637.     
  638.     THE ACCESS FAULT EXCEPTION VECTOR IS ALSO MODIFIED, TO PREVENT
  639.     ATTEMPTED WRITES TO THE KICKSTART FROM CAUSING A SOFTWARE FAILURE.
  640.     THE FASTROM KICKSTART IS WRITEPROTECTED WITHIN THE MMU TABLES. 
  641.     
  642.     For other anti-virus authors, it is easy to identify this handler
  643.     by fetching the pointer stored in coldcapture, subtracting four from
  644.     this address pointer and testing for the following value at that
  645.     memory location:
  646.     Hex value=$52535448 = RSTH in ascii
  647.     
  648.                                   Page 8    
  649.     
  650. PROGRAM EXAMPLES
  651.     
  652. *************************************************************************
  653.  ***********************************************************************
  654. NOTE    IN ALL THE FOLLOWING EXAMPLES, IF YOU ARE USING 68040.LIBRARY 
  655.     37.10 OR GREATER, THEN THE SETPATCH COMMAND MUST COME AFTER THE 
  656.     SET040 ENTRIES, AND THE SETPATCHPATCH COMMAND MUST BE DELETED AND 
  657.     NOT USED AT ALL.
  658.      CHECK THE VERSION OF 68040.LIBRARY YOU ARE USING AND MAKE SURE
  659.      YOU INSTALL CORRECTLY, OR IT WILL NOT WORK.
  660.  
  661. EXAMPLE OF INSTALLING A FASTROM (68040.library 37.10 or greater)
  662.  
  663.     To remap the rom, to fast ram with noclick drives:
  664.  
  665.     Set040 fastrom noclick
  666.     setpatch QUIET        <----Commodore's setpatch must come after
  667.                                 <----Delete the setpatchpatch entry
  668.  ***********************************************************************
  669. *************************************************************************     
  670.     
  671. EXAMPLE OF INSTALLING A FASTROM (Kickstarts up to and beyond V2.04)
  672.  
  673.     To remap the rom, to fast ram with noclick drives:
  674.  
  675.     Set040 fastrom noclick
  676.     SetPatchPatch            <-- the standard 'SetPatch' must already
  677.                          be installed.
  678.  
  679. EXAMPLE OF INSTALLING A KICKROM
  680.  
  681.     To install a KICKROM setup from a default file "DEVS:kickstart".
  682.                 
  683.         Set040 kickrom 
  684.  
  685.     To install a KICKROM as above, when KICKROM already installed.
  686.                 
  687.         Set040 kickrom force
  688.               
  689.     To install a KICKROM as above, when KICKROM already installed.
  690.                 
  691.         Set040 kickrom devs:kick force
  692.               
  693.     To install a kickrom option from a kickstart disk in df1:
  694.               
  695.         Set040 kickrom df1:
  696.         
  697. EXAMPLE OF CONVERTING KICKROM TO FASTROM
  698.  
  699.     To convert the KICKROM to FASTROM, with reset handler, and
  700.        noclick drives.
  701.          
  702.            Set040 fastrom reset noclick            
  703.         SetPatchPatch
  704.        
  705. EXAMPLE OF CONVERTING KICKROM TO FASTROM WITH THE FULLMAP OPTION
  706.  
  707.     To convert the KICKROM to FASTROM, with reset handler, and
  708.        noclick drives and install a FULLMAP type remap. This option
  709.        will require 1067570 bytes of LOCAL memory.
  710.          
  711.            Set040 fastrom fullmap reset noclick            
  712.         SetPatchPatch
  713.        
  714. EXAMPLE OF INSTALLING RESET HANDLER SEPERATELY
  715.      
  716.     The reset survival trap handler can be installed without
  717.        performing the KICKROM to FASTROM conversion by using RESET option.
  718.        If this option is given, the kickstart will remain in CHIP memory 
  719.        and be able to survive a reboot.
  720.        
  721.              Set040 reset
  722.              
  723.     NOTE, This option cannot be done after installation if you
  724.           are using kickstart 3.0, 68040.library 37.10 or greater.
  725.           The reset option must be given when installing Set040.             
  726.     
  727.                                   Page 9    
  728.      
  729. EXAMPLE OF KICKROMMING IN THE STARTUP-SEQUENCE
  730.  
  731.     If you want to use a different kickstart in the startup-
  732.     sequence and have this survive a reset and be in fast memory,
  733.     all that is required is three lines.
  734.     
  735.      The first line will only load the kickstart once, After this is
  736.      done the next boot will cause the first line to fail, as the output 
  737.      goes to nil: it is transparent to the user. The second line will 
  738.      then map it to fast ram and install the reset handler and no-click 
  739.      patch once.  After this both lines will transparently fail each boot.  
  740.      This saves you having to use IF/WARN/ENDIF statements.  
  741.      
  742.      For KICKROM-FASTROM survival you could use:-
  743.      
  744.     SetPatch quiet                <--- Normal Setpatch command
  745.      Set040 >nil: kickrom kickstartfile  
  746.      Set040 >nil: fastrom fullmap reset noclick
  747.     SetPatchPatch >nil:            
  748.                                          
  749.      For CHIP ram KICKROM survival you could use:-
  750.         
  751.     SetPatch quiet                <--- Normal Setpatch command
  752.     Set040 >nil: kickrom kickstartfile  
  753.      Set040 >nil: reset                  
  754.     SetPatchPatch >nil:            <--- MUST be after Setpatch and
  755.                                           AFTER Set040        
  756.                                           
  757.                                           
  758. EXAMPLE OF RESET REMOVAL
  759.  
  760.     Set040 noreset
  761.  
  762.     Removes the reset handler so that the next boot will
  763.     return to your ROM based kickstart.
  764.  
  765.               
  766. EXAMPLE OF CACHE MANIPULTION                  
  767.  
  768.     Disable both caches                      - Set040 nocache
  769.     Enable  both caches                      - Set040 cache
  770.     Disable Data Cache                       - Set040 nodcache
  771.     Enable  Data Cache                       - Set040 dcache
  772.     Enable  Both Caches and disable Copyback - Set040 cache nocopyback                           
  773.     Enable  Both Caches and enable  Copyback - Set040 cache copyback
  774.     Disable Both Caches and disable Copyback - Set040 nocache nocopyback
  775.             
  776.  
  777. EXAMPLE OF REMOVING FASTROM
  778.                
  779.     SET040 nofastrom
  780.    
  781.     NOTE:    This function is not possible on a KICKROM or KICKROM-FASTROM
  782.             setup.
  783.                 
  784.                                   Page 10    
  785.               
  786. EXAMPLE OF SWITCHING FROM 68030-68040 OR VICE-VERSA
  787.                 
  788.     Set040 togglecpu 
  789.          
  790.     One of the following cards must be installed.
  791.              
  792.     PP&S A3000-68040 card.
  793.           PP&S A3000 Mercury card.
  794.       *    PP&S A2000-68040 card.
  795.       *    PP&S A2000 Zeus card.
  796.     
  797.       *    TO DATE, THIS FUNCTION HAS ONLY BE TESTED ON THE FIRST TWO ENTRIES.
  798.                                
  799.     THIS SWITCH IS NOT PERMITTED ON 16MHZ A3000'S, AND SHOULD NOT
  800.     BE ATTEMPTED.  
  801.     
  802.     TOGGLECPU is the only option that is permitted on a 68030 CPU.  All 
  803.     other options  will display an error.  When this option is given,
  804.     a requester will open and will prompt you to either 'CHANGE' or 
  805.     'ABORT' via two gadgets.  If aborted, no further action takes 
  806.     place and the program will exit.  If 'CHANGE' is selected, another 
  807.     requester will open and prompt you to reboot the computer.  This 
  808.     requester will have a single 'ABORT' gadget, giving you a final 
  809.     chance to abort.  The actual reboot must be done by hand, using 
  810.     the keyboard, because the PP&S 68040 card requires a hardware reset 
  811.     to switch modes.  This cannot be generated with software.  (NO, 
  812.     the reset instruction will not work!) :-( 
  813.     
  814. IMPROVEMENTS
  815.     All suggestions will be carefully considered.
  816.     All bugs will be rectified A.S.A.P.
  817.     I will attempt to overcome all incompatibilities 
  818.     if sufficient information on your particular board
  819.     is supplied ie. amount of onboard ram, address of such
  820.     ram, A3000 or A2000 board, full description of other
  821.     hardware you use, full description of any plug in cards,
  822.     full description of your Amiga, OS version numbers, etc!!
  823.     
  824.                                   Page 11    
  825.               
  826. TECHNICAL NOTES 
  827.  
  828.     The average user may not completely understand the following
  829.     notes, suffice to say an understanding of how this program
  830.     works is not required.  Information given here is mainly
  831.     for the benefit of the experienced user or interested programmer.
  832.     These notes may be of some help if you experience problems
  833.     with certain 68040 cards.
  834.     
  835.     NOTE: The termination for certain address has been taken from
  836.           the latest information I have available on the memory map
  837.           for the A3000 series of computers and is dated July 1991.
  838.  
  839.     I wrote this program for a few reasons.  To gain knowledge 
  840.     in programming the 68040 processor in assembler and to discover 
  841.     the differences from its older brothers.  I wanted to test Macro68 
  842.     assembler in 68040 instructions.  When I ran a test of the difference 
  843.     in speed between reading the ROMS and reading FAST RAM, I realized a 
  844.     68040 MMU program was a necessity.  I found that while reading the 
  845.     ROMS the 68040 was only marginally faster than the 68030, yet in 
  846.     FAST RAM the 68040 leaves the 68030 standing.
  847.  
  848.     The MMU set-up remaps the kickstart ROMS to FAST RAM, and allows 
  849.     for instruction caching of the address areas the same as for the 
  850.     data areas mentioned below.  This set-up protects the new kickstart 
  851.     by marking this area of memory as write-protected in the ATC table 
  852.     entries.  This remap is faster than the hardware FASTROM that
  853.     is being done on some 68040 cards.  Testing has shown that a MMU
  854.     remap is between two and three times the speed of a hardware map.
  855.  
  856.     Re-mapping kickstart to FAST RAM poses a few problems because of 
  857.     the design of the 68040 MMU.  Most of the first 16MB of the Amiga 
  858.     memory map must be set for non-cachable serialized.  The rest of 
  859.     the 4 gigabyte space can be set for cachable copyback,  but because 
  860.     of limitations of the 68040 MMU, programming this is not easy.  The 
  861.     standard V2.04 or PP&S set-up manages this by using both of the Data 
  862.     Transparent Translation registers.  This works fine but does not 
  863.     allow for re-mapping of the kickstart.  The 68040 MMU looks at 
  864.     Transparent Translation registers first, and if an address matches, 
  865.     the ATC tables are not accessed.   Therefore a remap of the kickstart 
  866.     would not be seen if we used the same values in the transparent 
  867.     registers as PP&S, or Commodore uses. 
  868.     
  869.     The 68040 has a simple 3 level ATC table and page sizes of either
  870.     4k or 8k.  Our set-up discussed here uses the 8k page size.
  871.     If the ATC is used, each entry in the first table covers 32MB.  
  872.     This means that we must at least have entries in this table 
  873.     for that address space.  If we want this entire 32MB to be valid
  874.     we must have complete entries in the second and third tables to 
  875.     cater for it.  This is not a large problem but does use around 
  876.     17k of memory for each 32MB space covered in the table.  The 
  877.     problem is enhanced due to the fact the 68040 does not support 
  878.     'early termination descriptors' as the 68030 did. 
  879.  
  880.     The next problem exists because, two of each data and instruction
  881.     transparent translation registers are not enough to control the 
  882.     rest of the space.  We could put all entries in the ATC tables, 
  883.     but this would mean very large tables and make it difficult to 
  884.     control the copyback mode over a large area.  A mode similar to
  885.     this has been catered for by Set040 as an option and still allows.
  886.     for compatibility with the CPU040 program from PP&S, CPU from 
  887.     Commodore and any other 68040 cache manipulation program that uses
  888.     the OS routines for manipulation of the caches and modes.
  889.                                   
  890.                                   Page 12    
  891.                                   
  892.     Set040 allows for two different setups.  These allow for either a 
  893.     smaller memory efficient setup, or a full setup that requires just 
  894.     over one megabyte of memory.     
  895.     
  896. THE DEFAULT SETUP
  897.     
  898.     The first 16MB is set in the tables as non-cachable serialized.  
  899.     Copyback mode for the second, third and fourth 16MB spaces can be 
  900.     conrolled globally between copyback or writethrough before or after 
  901.     installation, by command line options.  The addresses of this  48MB 
  902.     space is $1000000 - $3FFFFFF.
  903.               
  904.     The next 64MB address space ($4000000 - $7FFFFFF) is controlled
  905.     by one each of the two data and instruction transparent translation 
  906.     registers for the data and instruction spaces respectively.  The 
  907.     data register is set for cachable copyback unless the NODTT1CBACK 
  908.     option is used at installation.  This can be changed after 
  909.     installation with the various copyback options.  The instruction 
  910.     registers are set for cachable.
  911.  
  912.     The above caters for the first 16MB and the area defined as 
  913.     'A3000 mother board space'.  Above this area we have a 128MB 
  914.     space which is defined as "CoProcessor Slot Expansion".  This is 
  915.     controlled by the second data and instruction transparent translation 
  916.     registers and can be optionally switched between copyback or 
  917.     writethrough before or after installation by command line options.  
  918.     This area will default to copyback at installation unless NODTT0CBACK 
  919.     option is given.
  920.  
  921.     All the ATC entries except for the kickstart remap entries actually 
  922.     get transparently translated.  The 68040 users guide states that if 
  923.     the physical address equals the logical address in a page entry, then
  924.     that entry is transparently translated.  Transparent translation means
  925.     that there is no CPU overhead to do the translation.  The kickstart 
  926.     remap routine makes use of the new 'MOVE16' instruction to copy the ROM 
  927.     image into ram.  This allows for a very fast copy and saves having to 
  928.     call OS routines to flush the caches after the copy, as the Move16 
  929.     instruction does not permit caching of the data copied and invalidates
  930.     any entries in the cache for the destination addresses.  
  931.  
  932.     The rest of the map which ranges from $10000000-$FFFFFFFF has been 
  933.     set as invalid, simply to conserve memory.  The default set-up should
  934.     allow for the good compatibility between different 68040 cards with 
  935.     the least use of memory.  
  936.     
  937.                                   Page 13    
  938.               
  939. THE FULLMAP SETUP
  940.  
  941.     This mode allows for mapping of the entire 4 gigabyte space with
  942.     memory usage of a little over a megabyte, including the Kickstart
  943.     image.
  944.     
  945.     The first one gigabyte of address space is controlled by the ATC.
  946.     The second gigabyte is controlled by the DTT0 and ITT0 transparent
  947.     translation registers, and the third and fourth gigabytes are 
  948.     controlled by the DTT1 and ITT1 registers.  Caches for the first
  949.     16MB of the address space is set the same as the default setup.
  950.     
  951.     All of the remaining address space is set for cachable copyback,
  952.     but this can be somewhat controlled by various command line options.
  953.     For further information see the FULLMAP description on page 6.
  954.  
  955.     When programming these setups, I attempted to keep them fully 
  956.     compatible with the standard programs from Commodore and PP&S.
  957.     This was done in the way of a stand alone program called SetPatchPatch.
  958.     This 'patch' allows the CPU, CPUSet, CPU040 and other correctly
  959.     written programs to be fully aware of the MMU setup that Set040 has
  960.     installed.  In cases where the program that was supplied with your 
  961.     card is not written correctly, I suggest you either use Set040 or one
  962.     of the above programs for cache manipulation.  Yours can be tested
  963.     by using one of the above, and taking note of the effect it has
  964.     when the 'Set040 verbose' command is issued.  Your program should
  965.     have EXACTLY the same effect as one of the above or Set040 does, 
  966.     otherwise it is not correctly written.
  967.  
  968. TRADEMARKS 
  969.                
  970.  AmigaDOS, Amiga and Kickstart are trademarks of Commodore Amiga Inc.
  971.  PP&S is an abbreviation for Progressive Peripherals and Software.
  972.  MC68030, MC68040 and Motorola are trademarks of Motorola Inc.               
  973.  
  974. REFERENCES
  975.                 
  976.  M68000PM/AD  Programmers Reference Manual (inc. CPU32)
  977.  Published by Motorola Literature Distribution USA.
  978.  M68000UM/AD  8-/16-/32-Bit MicroProcessor User's Manual Eighth Edition.
  979.  Published by PRENTICE HALL, Englewood Cliffs, N.J. 07632
  980.  MC68040UM/AD 32-Bit MicroProcessor User's Manual
  981.  Published by Motorola Literature Distribution USA.
  982.  MC68030UM/AD 32-Bit MicroProcessor User's Manual
  983.  Published by Motorola Literature Distribution USA.
  984.  MC68040 Errata notes supplied by William J Coldwell.
  985.  
  986.                                    Page 14    
  987.               
  988.